package com.ophiux.member.api.fallback;

import com.ophiux.common.core.base.Result;
import com.ophiux.member.api.feign.IMemberFeignApi;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * 进入fallback的方法 检查是否token未设置
 */
@Slf4j
public class MemberFeignAPIFallback implements IMemberFeignApi {

    @Setter
    private Throwable cause;

    @Override
    public String getUserById(Integer userId) {
        log.error("发送消息失败 {}", cause);
        return null;
    }

    @Override
    public Result updateAmount(Integer amount) {
        log.error("扣减金额失败 {}", cause);
        return Result.fail();
    }
}
